package com.zheng.oauthserver.config;

import com.zheng.oauthserver.component.JwtTokenEnhancer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.security.oauth2.provider.token.TokenStore;
import org.springframework.security.oauth2.provider.token.store.JwtAccessTokenConverter;
import org.springframework.security.oauth2.provider.token.store.JwtTokenStore;
import org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStore;

/**
 * 使用redis存储token的配置
 */
//@Configuration
public class RedisTokenStoreConfig {
    @Autowired
    RedisConnectionFactory factory;

    @Bean
    public TokenStore redisTokenStore() {
        return new RedisTokenStore(factory);
    }
}
